%Lets open an image up in Matlab
MyImage = imread('C:\Users\Andrew Paek\Dropbox\Courses\MCB585\2019\Data\Segmentation\2018-08-17-wella1-24hr-starved-c4-05-06.tif');
%Look at the data in the image by double clicking MyImage in the workspace or by typing MyImage in the command window. What do you think these numbers mean?
%To view the image we use the function imshow
imshow(MyImage)
%We can also view a small portion of the image using the following command
imshow(MyImage(300:600,300:600))
%Another way to view the image is by using imtool
imtool(MyImage)
% In the figure window we have now available the following tools: overview, pixel region, image information, adjust contrast and zoom. Try them.
%
% Move your curser over the image. At the bottom left of the Image Tool figure it should show you the coordinates and pixel intensity
%
% There are different image types and image classes available in MATLAB. The two primary image
% types you will be working with are as follows
% • Intensity images
% • uint16 [0, 65535] (CCD cameras on microscopes)
% • uint8[0, 255] (From your standard digital camera)
% • double [-10308, 10308]
% • Binary images (black and white)
% • logical, 0 or 1
%
% Many biological images comprise of light objects over a constant dark background (especially those obtained using fluorescence microscopy), in such a way that object and background pixels have gray levels grouped into two dominant modes. One obvious way to extract the objects from the background is to select a threshold T that separates these modes:
% g(x,y) = 1 if f(x,y) > T
% = 0 otherwise
%
% where g(x,y) is the thresholded binary image of f(x,y). We can implement the thresholding operation in MATLAB by the following function:
%
% g = im2bw(f,T)
%
% The first argument f gives the input image, and the second argument T gives the threshold value. Note the threshold needs to be a number between 0 and 1 and refers to the signal levels possible. Our 16 but image scales from 0 to 65535 so a value of .1 would make everything under 6,554 a 0 and everything above it a 1
%
% Lets Try it with our image pick a background level by mousing over the image and looking at the intensities for background and for the nuclei. What signals do you get for background?
MyImageThresh = im2bw(MyImage,.18);
%Take a look at the image with imshow
imshow(MyImageThresh)
%Was this a good threshold? How do we know what part of our signal is the
%background and what is the foregroud. One way would be to look at a
%histogram of the pixel intensity
imhist(MyImage)
%Lets Load Another Image This image
MyImage2 = imread('C:\Users\Andrew Paek\Dropbox\Courses\MCB585\2019\Data\Segmentation\2018-08-17-wella1-24hr-starved-c3-05-06.tif');
imshow(MyImage2)